package interview.MathClass;

import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;

/**
 * @Author: Jun
 * @Date: 2018/9/8 10:24
 */
public class MathDemo {
    public static void main(String[] args) {
        Double d1=56.5;
        Double d2=-56.9;
        System.out.println(Math.floor(d1));
        System.out.println(Math.floor(d2));
        System.out.println(Math.round(d1));
        System.out.println(Math.round(d2));
        System.out.println(Math.ceil(d1));
        System.out.println(Math.ceil(d2));

        String a="asdf";
        String b="asdf";
        System.out.println(a.equals(b));
        System.out.println(a==b);
        String c=new String("asdf");
        System.out.println(a.equals(c));
        System.out.println(a==c);

        Integer num1=123;
        Integer num2=123;
        System.out.println(num1==num2);
        System.out.println(num1.equals(num2));

        Map map=new HashMap();
        Hashtable hashtable=new Hashtable();

        String helloword="hello world";
        String hello="hello";
        System.out.println(helloword=="hello"+" word");
        System.out.println(helloword==hello+" word");
        System.out.println(helloword.intern()==(hello+" world").intern());
    }
}
